<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>查询数据表页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
    <style>
        .el-switch {
            border: 1px solid #dcdfe6;
            height: 34px;
            border-radius: 4px;
            padding: 0 10px;
            margin-bottom: 15px;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="query">
            <div class="header">
                <div style="margin: 0 15px; display: flex; align-items: center; flex-wrap: wrap;">
                    <span style="margin-bottom: 15px;">表名/备注：</span><el-input size="medium" v-model="form.Data" style="width: 200px; margin-right: 10px;"
                        placeholder="请输入表名/备注" clearable></el-input>
                    <el-button icon="el-icon-search" size="medium" style="margin-right: 10px;"   @click="handleSerach">查询</el-button>
                    <el-switch v-model="form.isCommentNull" size="medium" style="margin-right: 10px;" @change="handleSerach"
                        active-value="1" inactive-value="0" active-text="仅查未备注表" inactive-text=""></el-switch>
                    <el-switch v-model="form.keepState" size="medium" style="margin-right: 10px;" @change="handleSerach"
                        active-value="1" inactive-value="0" active-text="开启记忆查询" inactive-text=""></el-switch>
                    <!-- <el-button icon="el-icon-circle-plus-outline" size="medium" type="primary" @click="handleAdd" plain round>添加</el-button> -->
                </div>
            </div>
            <el-row class="main" type="flex">
                <el-col :span="24" class="right"><!-- 如果有tabs 高度要调整  -->
                    <el-table id="table" height="calc(100% - 47px)" v-loading="loading" ref="multipleTable"
                        tooltip-effect="dark" border :data="tableData">
                        <el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
                        <el-table-column prop="TABLE_NAME" show-overflow-tooltip label="表名"
                            min-width="250"></el-table-column>
                        <el-table-column prop="TABLE_COMMENT" label="表备注" min-width="250">
                            <template v-slot="{row}">
                                <span :style="{color:row.TABLE_COMMENT?'':'#F56C6C'}">
                                    {{row.TABLE_COMMENT?row.TABLE_COMMENT:'未备注'}}
                                </span>
                            </template>
                        </el-table-column>
                        <el-table-column label="主键自增情况" min-width="220">
                            <template v-slot="{row}">
                                <span :style="{color:row.Document_Length==''?'#E6A23C':''}">{{row.Document_Length ==
                                    ''?'自定义主键':row.Document_Head + '开头自动递增,共' + row.Document_Length + '位'}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="ROW_COUNT" label="表中数据条数" min-width="140">
                            <template v-slot="{row}">
                                共{{row.ROW_COUNT}}条数据
                            </template>
                        </el-table-column>
                        <el-table-column prop="COLUMN_COUNT" label="字段总数" min-width="140">
                            <template v-slot="{row}">
                                共{{row.COLUMN_COUNT}}个字段
                            </template>
                        </el-table-column>
                        <el-table-column prop="COMMENTED_COUNT" label="备注字段数" min-width="140">
                            <template v-slot="{row}">
                                已备注{{row.COMMENTED_COUNT}}个字段
                            </template>
                        </el-table-column>
                        <el-table-column label="字段备注状态" min-width="140">
                            <template v-slot="{row}">
                                <span :style="{color:row.COLUMN_COUNT != row.COMMENTED_COUNT?'#F56C6C':'#67C23A'}">
                                    {{row.COLUMN_COUNT !=
                                    row.COMMENTED_COUNT?(Number(row.COLUMN_COUNT)-Number(row.COMMENTED_COUNT)) +
                                    '个未备注字段':'字段已全部备注'}}
                                </span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" prop="CREATE_TIME" label="创建时间"
                            min-width="180"></el-table-column>
                        <el-table-column align="center" prop="UPDATE_TIME" label="最后修改时间"
                            min-width="180"></el-table-column>
                        <el-table-column align="center" label="操作" fixed="right" width="160">
                            <template v-slot="{row}">
                                <div style="display: flex; align-items: center;">
                                    <el-button size="small" style="margin-right: 10px;" @click="handleEdit(row)">
                                        编辑
                                    </el-button>
                                    <el-dropdown trigger="click" @command="handleCommand($event,row)">
                                        <el-button type="danger" size="small">
                                            更多 <i class="el-icon-arrow-down el-icon--right"></i>
                                        </el-button>
                                        <template #dropdown>
                                            <el-dropdown-menu>
                                                <el-dropdown-item command="handleDetail">
                                                    查看详情
                                                </el-dropdown-item>
                                                <el-dropdown-item command="handleShow">
                                                    查看数据
                                                </el-dropdown-item>
                                            </el-dropdown-menu>
                                        </template>
                                    </el-dropdown>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                    <el-pagination style="margin-top: 1%;" :current-page="form.Page" :page-size="form.Limit" background
                        :page-sizes="[20, 30, 60, 100, 500]" layout="total, sizes, prev, pager, next, jumper"
                        :total="Total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
                </el-col>
            </el-row>
        </div>
    </div>
    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.full.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../utils/components.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../utils/http.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>

</html>